package com.zhengbing.tj.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.AllArgsConstructor;

/**
 * 用户角色关联实体类
 * 管理用户与角色之间的多对多关系
 *
 * @author zhengbing
 * @date 2024-08-22
 */
@TableName("user_role")
@Api(tags = "用户角色关联")
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
public class UserRole extends Model<UserRole> {
    /**
     * 主键ID
     */
    @ApiModelProperty(value = "主键ID", example = "123456789012345678")
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;
    
    /**
     * 用户ID
     */
    @ApiModelProperty(value = "用户ID", example = "123456789012345678")
    private Long userId;
    
    /**
     * 角色ID
     */
    @ApiModelProperty(value = "角色ID", example = "123456789012345678")
    private Long roleId;
    
    // 显式添加getter和setter方法以确保编译通过
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public Long getUserId() {
        return userId;
    }
    
    public void setUserId(Long userId) {
        this.userId = userId;
    }
    
    public Long getRoleId() {
        return roleId;
    }
    
    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }
}